<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form method="post" id="form-summit">
    <label for="name">名字</label>
    <input type="text" name="name" id="name"><br>
    <label for="occupation">职业</label>
    <input type="text" name="occupation" id="occupation"><br>
    <input type="submit" name="submit" value="登录">
</form>

<script>
    // 1. 获取表单元素
    const myForm = document.getElementById("form-summit");

    // 2. 直接在控制台打印这个元素对象
    console.log(myForm.elements );
</script>
</body>
</html>